
#include <board.h>

#if defined(CONFIG_BOARD_AUDIO) && CONFIG_BOARD_AUDIO

#ifdef CONFIG_SMART_AUDIO
#include <smart_audio.h>

/* 音量曲线，数组中的值是对应数字音量处理的db值的id号，对应db值可以使用 smta volmap命令进行查询*/
static uint8_t g_vol_map[101] = {
    1,   28,  30,  32,  34,  36,  38,  40,  42,  44,  46,  48,  50,  52,  54,  56,  58,  60,  62,  64,  66,
    68,  70,  72,  74,  76,  78,  80,  82,  84,  86,  88,  90,  92,  94,  96,  98,  100, 102, 104, 106, 108,
    110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150,
    152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192,
    194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226,
};

/* db_min和db_max 用来建立256个db值对应的计算因子 */
audio_vol_config_t g_vol_config = { -45, 6, g_vol_map };

/*
以下-45, 6,为参数的列表，截取-40db~0db的数据，id列用于填入g_vol_map数组中
----------------------
id,db,与上一个db的差值
----------------------
28,-39.452,0.201
29,-39.255,0.197
30,-39.063,0.192
31,-38.875,0.188
32,-38.690,0.184
33,-38.465,0.225
34,-38.289,0.176
35,-38.074,0.215
36,-37.864,0.210
37,-37.660,0.205
38,-37.459,0.200
39,-37.264,0.196
40,-37.072,0.191
41,-36.885,0.187
42,-36.666,0.219
43,-36.452,0.214
44,-36.277,0.174
45,-36.073,0.205
46,-35.873,0.200
47,-35.677,0.196
48,-35.454,0.223
49,-35.268,0.186
50,-35.055,0.213
51,-34.877,0.178
52,-34.674,0.203
53,-34.475,0.199
54,-34.281,0.194
55,-34.064,0.217
56,-33.878,0.185
57,-33.671,0.207
58,-33.469,0.202
59,-33.271,0.198
60,-33.078,0.193
61,-32.866,0.212
62,-32.681,0.185
63,-32.478,0.203
64,-32.280,0.198
65,-32.064,0.215
66,-31.875,0.189
67,-31.669,0.206
68,-31.469,0.201
69,-31.272,0.196
70,-31.080,0.192
71,-30.874,0.206
72,-30.672,0.202
73,-30.475,0.197
74,-30.283,0.193
75,-30.077,0.205
76,-29.877,0.201
77,-29.681,0.196
78,-29.473,0.208
79,-29.270,0.203
80,-29.072,0.198
81,-28.878,0.194
82,-28.675,0.204
83,-28.475,0.199
84,-28.281,0.195
85,-28.077,0.204
86,-27.878,0.199
87,-27.683,0.195
88,-27.480,0.203
89,-27.281,0.198
90,-27.087,0.194
91,-26.886,0.201
92,-26.678,0.208
93,-26.485,0.192
94,-26.286,0.199
95,-26.081,0.205
96,-25.880,0.201
97,-25.684,0.196
98,-25.483,0.202
99,-25.286,0.197
100,-25.083,0.202
101,-24.886,0.198
102,-24.693,0.193
103,-24.486,0.207
104,-24.292,0.193
105,-24.086,0.206
106,-23.893,0.193
107,-23.688,0.205
108,-23.496,0.192
109,-23.292,0.204
110,-23.093,0.199
111,-22.891,0.202
112,-22.694,0.197
113,-22.494,0.200
114,-22.298,0.196
115,-22.093,0.205
116,-21.900,0.193
117,-21.698,0.202
118,-21.500,0.198
119,-21.301,0.199
120,-21.100,0.201
121,-20.898,0.202
122,-20.700,0.198
123,-20.501,0.199
124,-20.301,0.200
125,-20.101,0.201
126,-19.904,0.196
127,-19.702,0.202
128,-19.505,0.198
129,-19.307,0.198
130,-19.108,0.198
131,-18.905,0.203
132,-18.706,0.199
133,-18.508,0.199
134,-18.309,0.199
135,-18.110,0.198
136,-17.908,0.202
137,-17.710,0.198
138,-17.513,0.197
139,-17.312,0.201
140,-17.112,0.200
141,-16.913,0.199
142,-16.715,0.198
143,-16.514,0.201
144,-16.317,0.196
145,-16.115,0.202
146,-15.917,0.198
147,-15.717,0.200
148,-15.519,0.198
149,-15.319,0.200
150,-15.120,0.199
151,-14.920,0.200
152,-14.721,0.199
153,-14.521,0.200
154,-14.323,0.198
155,-14.124,0.199
156,-13.924,0.200
157,-13.724,0.200
158,-13.525,0.198
159,-13.326,0.199
160,-13.127,0.199
161,-12.928,0.200
162,-12.728,0.200
163,-12.528,0.200
164,-12.331,0.197
165,-12.132,0.199
166,-11.932,0.199
167,-11.732,0.201
168,-11.533,0.198
169,-11.334,0.200
170,-11.135,0.199
171,-10.934,0.200
172,-10.735,0.199
173,-10.537,0.198
174,-10.337,0.199
175,-10.138,0.200
176,-9.939,0.199
177,-9.740,0.199
178,-9.540,0.199
179,-9.341,0.200
180,-9.142,0.198
181,-8.943,0.200
182,-8.743,0.200
183,-8.544,0.199
184,-8.345,0.199
185,-8.146,0.199
186,-7.947,0.199
187,-7.747,0.200
188,-7.548,0.198
189,-7.348,0.200
190,-7.149,0.199
191,-6.950,0.199
192,-6.751,0.199
193,-6.552,0.198
194,-6.353,0.199
195,-6.153,0.199
196,-5.954,0.199
197,-5.755,0.200
198,-5.555,0.199
199,-5.357,0.199
200,-5.157,0.200
201,-4.957,0.199
202,-4.759,0.198
203,-4.559,0.199
204,-4.360,0.199
205,-4.161,0.199
206,-3.961,0.200
207,-3.762,0.199
208,-3.563,0.199
209,-3.364,0.199
210,-3.165,0.199
211,-2.965,0.200
212,-2.766,0.199
213,-2.567,0.199
214,-2.368,0.199
215,-2.168,0.200
216,-1.969,0.199
217,-1.770,0.199
218,-1.571,0.199
219,-1.371,0.199
220,-1.172,0.199
221,-0.973,0.199
222,-0.774,0.199
223,-0.575,0.199
224,-0.375,0.199
225,-0.176,0.199
226,0.000,0.176
*/
#endif /*CONFIG_SMART_AUDIO*/
#endif /*CONFIG_BOARD_AUDIO*/
